{% extends 'eform_base_no_nav.html' %}
{% load static %}
{% load i18n %}
{% block title %}
    <title></title>
{% endblock title %}
    


{% block head %}
<link rel='stylesheet' href="{% static 'eform/formio.full.min.css' %}">
<style type="text/css" media="print">
    .no-print { display: none; }

 </style>
<style>
    
@media print{
    .col-print-12{width:100% !important;}
    .col-md-10{
        width: 100%  !important;
    }
}
    .staff-name{
        
        min-width:180px;
        display: inline-block;
        margin: 0 50px 0 50px;
    }
    .imte-table .row{
        margin: 0;
        padding: 0;
    }
    .imte-table .col{
        margin: 0;
        padding: 5px;
        border: 1px solid black;
    }

    #btn-zoom{
        position: fixed;
        left : 13px;
        bottom: 10px;
        z-index: 10001;
        transition: 0.2s;
    }

    #btn-scroll-up{
        position: fixed;
        left : 130px;
        bottom: 10px;
        z-index: 10001;
        transition: 0.2s;
    }

    #btn-scroll-down{
        position: fixed;
        left : 80px;
        bottom: 10px;
        z-index: 10001;
        transition: 0.2s;
    }
</style>
{% endblock head %}
    


{% block bodyclass %}
h-100
{% endblock bodyclass %}
{% block body %}

{% include 'importcsv.html'%}

<!-- <div class="container-fluid mt-3">
    <button type="button" id="log-data" class="btn btn-primary">Log Data</button>
</div> -->

<!-- <a class="gnslogo p-3" href="#" onclick="gobackurl({{eform.workOrderList.pk}})" >
    <img src="{% static 'lead/media/wlogo_only.png' %}">
</a> -->
<button type="button" class="btn-secondry px-3" id="btn-scroll-up"><i class="fa fa-arrow-circle-up" aria-hidden="true"></i></button>
<button type="button" class="btn-secondry px-3" id="btn-scroll-down"><i class="fa fa-arrow-circle-down" aria-hidden="true"></i></button>

<button type="button" class="btn btn-primary px-3 " id="btn-zoom"><i class="fa fa-lg fa-search-minus" id="zoom-fa" aria-hidden="true"></i></button>
<div class="container-fluid mt-5" >
        <!--
        {% if not OCR_DETECTION_IP %}
            <div class="alert alert-warning alert-dismissible fade show" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                    <span class="sr-only">Close</span>
                </button>
                <strong>No table is paried with current device, cannot establish connection with AI model. You may want to pair up table and tablet in <a href="#" onclick="gobackurl({{eform.workOrderList.pk}})">Workstation</a> page.</strong>
            </div>
        {% endif %} -->

        {% if csv_msg %}
        {% for msg in csv_msg %}
            {% if msg %}
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                    <span class="sr-only">Close</span>
                </button>
                <strong>{{msg}}</strong>
            </div>
            {% endif %}
        {% endfor %}
        {% endif %}
        
        {% if eform.title == 'Odometer'%}
        <div class="d-flex justify-content-end">
            <div class="mr-auto"><a name="" id="" class="no-print btn btn-primary mb-3" href="#" onclick="gobackurl({{eform.workOrderList.pk}})" role="button"><i class="fa fa-backward" aria-hidden="true"></i>  Back</a></div>
            <div>
                <button type="button" class="btn btn-info mb-3" data-toggle="modal" data-target="#exampleModal">
                    <i class="fa fa-file"></i>  Import
                  </button>
            </div>
        </div>
        {% endif %}
        
        <div class="row"  >
            <div id="eform_container" class="
            {% if is_psu or is_meter %}
            col-10
            {% else %}
            col-12
            {% endif %}
            ">
                
                {% if message %}
                    <div class="alert
                    {% if color %}
                        alert-{{color}}
                    {% else %}
                        alert-warning
                    {% endif %}
                         alert-dismissible fade show" role="alert">
                      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                      </button>
                      <strong>{{message}}</strong> 
                    </div>
                    
                    <script>
                      $(".alert").alert();
                    </script>
                {% endif %}
                <!-- <a name="" id="" class="btn btn-primary" href="" role="button">Back</a> -->
                <div class="card">

                    <div class="card-header no-print">
                        <h1>{{eform.title}}</h1>
                    </div>
                    <div class="card-body">
        
                        <div class="row">
                            <div class="col-lg-4 col-12">
                                <div class="form-group">
                                    <label for="form_no">Form No. </label>
                                    <input type="text" readonly value="{{eform.formNo}} {% if eform.issue %}({{eform.issue}}){% endif %}" 
                                    class="form-control" name="form_no" id="form_no" aria-describedby="form_no" placeholder="Form No.">
                                </div>
                            </div>
                            
                            
                        
                        
                            <div class="col-lg-4 col-12">
                                <div class="form-group">
                                    <label for="ref">Ref.</label>
                                    <input type="text" readonly value="{{eform.ref}}"
                                    class="form-control" name="ref" id="ref" aria-describedby="ref" placeholder="Ref">
                                </div>
                            </div>
                            <div class="col-lg-4 col-12">
                                <div class="form-group">
                                    <label for="form_title">Form Issue Date</label>
                                    <input type="text" readonly value="{{eform.form_issue_date|date:'Y-m-d'}}"
                                    class="form-control" name="" id="" aria-describedby="" placeholder="">
                                </div>
                            </div>
                            {% comment %} <div class="col-lg-6 col-12">
                                <div class="form-group">
                                    <label for="">Endorse Require</label>
                                    <input type="text" readonly value="{{eform.eformSchema.get_endorsor_require_display}}"
                                    class="form-control" name="ref" id="ref" aria-describedby="ref" placeholder="Ref">
                                </div>
                            </div> {% endcomment %}
                        </div>
                            
                        <hr>
                        <div class="row">
                            <div class="col-sm-12 col-md-3 ">
                                <div class="form-group">
                                  <label for="">Serial Number</label>
                                  <input value="{{serial_no|default:''}}"
                                  type="text" class="form-control wo-fields" readonly name="wo_serial" id="id_wo_serial" aria-describedby="helpId" placeholder="">
                                </div>    
                            </div>
                            <div class="col-sm-12 col-md-3 ">
                                <div class="form-group">
                                  <label for="">Location</label>
                                  <select class="form-control wo-fields" form="eform"  name="wo_location" id="id_wo_location">
                                        <option value>---------</option>
                                      {% for l in locations %}
                                          <option value="{{l}}" key="{{forloop.counter}}"
                                          {% if l.id == eform.workOrder.location.id %}
                                              selected
                                          {% endif %}
                                              >{{l}}</option>
                                      {% endfor %}
                                  </select>
                                  <!-- <input value="{{eform.workOrderList.location|default:''}}"
                                  type="text" class="form-control wo-fields"  name="wo_location" id="id_wo_location" aria-describedby="helpId" placeholder=""> -->
                                </div>    
                            </div>
                           <div class="col-sm-12 col-md-3 ">
                                <div class="form-group">
                                    <label for="">FAILURE SYMPTOM</label>
                                    <input form="eform" value="{{failure_sym|default:''}}" 
                                    type="text" class="form-control wo-fields"  name="wo_failure_sym" id="id_failure_sym" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>
                            <div class="col-sm-12 col-md-3 ">
                                <div class="form-group">
                                  <label for="">RECEIVED DATE</label>
                                  <input value="{{received_date}}"
                                  type="date" class="form-control wo-fields" form="eform" name="wo_received_date" id="id_received_date" aria-describedby="helpId" placeholder="">
                                </div>    
                            </div>

                        </div>
                        <div class="row">
                        
                            <div class="col-sm-12 col-md-3 ">
                                <div class="form-group">
                                  <label for="">Equipment / Assembly</label>
                                  <input value="{{equipment|default:''}}"
                                  type="text" class="form-control wo-fields" readonly name="wo_serial" id="id_wo_serial" aria-describedby="helpId" placeholder="">
                                </div>    
                            </div>

                            <div class="col-sm-12 col-md-3 ">
                                <div class="form-group">
                                  <label for="">LINE ORDER</label>
                                  <input value="{{line_order|default:''}}"
                                  type="text" class="form-control wo-fields" form="eform" name="wo_line_w_order" id="id_line_w_order" aria-describedby="helpId" placeholder="">
                                </div>    
                            </div>
                            <div class="col-sm-12 col-md-3 ">
                                <div class="form-group">
                                <label for="">CEWS ORDER</label>
                                <input value="{{cews_order|default:''}}"
                                type="text" class="form-control wo-fields" form="eform" name="wo_cews_w_order" id="id_cews_w_order" aria-describedby="helpId" placeholder="">
                                </div>    
                            </div>
                            
                             <div class="col-sm-12 col-md-3 ">
                                <div class="form-group">
                                    <label for="">CHECKED DATE</label>
                                    <input value="{{eform.workOrder.checked_date}}"
                                    type="date" class="form-control wo-fields" form="eform" name="wo_checkout_date" id="id_checkout_date" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>
                        </div> 
                        
                        {% comment %} <div class="row">
                            
                            <div class="col-sm-12 col-md-4 ">
                                <div class="form-group">
                                  <label for="">Work Order Type</label>
                                  <input value="{{eform.workOrderList.wo_type|default:''}}"
                                  type="text" class="form-control" readonly name="wo_type" id="id_wo_type" aria-describedby="helpId" placeholder="">
                                </div>    
                            </div>

                            <div class="col-sm-12 col-md-4 ">
                                <div class="form-group">
                                  <label for="">EQPT./CAR NO.</label>
                                  <input value="{{eform.workOrderList.carno|default:''}}"
                                  type="text" class="form-control" readonly name="carno" id="id_carno" aria-describedby="helpId" placeholder="">
                                </div>    
                            </div>
                                  
                            
                            
                            
                            <div class="col">
                                <div class="form-group">
                                    <label for="">EQPT. DESCRIPTION</label>
                                    <input value="{{eform.workOrderList.eqip_des|default:''}}"
                                    type="text" class="form-control" readonly name="eqip_des" id="id_eqip_des" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>
                          
                            <div class="col-sm-12 col-md-4 ">
                                <div class="form-group">
                                    <label for="">RETURN TO</label>
                                    <input value="{{eform.workOrderList.return_to|default:''}}"
                                    type="text" class="form-control" readonly name="return_to" id="id_return_to" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>

                            <div class="col-sm-12 col-md-4 ">
                                <div class="form-group">
                                    <label for="">CREATE STAFF</label>
                                    <input value="{{eform.workOrderList.create_staff}}"
                                    type="text" class="form-control" readonly name="create_staff" id="id_create_staff" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>
                           
                            <div class="col-sm-12 col-md-4 ">
                                <div class="form-group">
                                    <label for="">WO RESULT</label>
                                    <input value="{{eform.workOrderList.wo_result|default:''}}"
                                    type="text" class="form-control" readonly name="wo_result" id="id_wo_result" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>


                            <div class="col-sm-12 col-md-4 ">
                                <div class="form-group">
                                    <label for="">CONTRACTOR ORDER NO.</label>
                                    <input value="{{eform.workOrderList.contractor_ref_order|default:''}}"
                                    type="text" class="form-control" readonly name="contractor_ref_order" id="id_contractor_ref_order" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>
                            <div class="col-sm-12 col-md-4 ">
                                <div class="form-group">
                                    <label for="">CHECK OUT DATE</label>
                                    <input value="{{eform.workOrderList.checkout_date|default:''}}"
                                    type="text" class="form-control" readonly name="checkout_date" id="id_checkout_date" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>
                            <div class="col-sm-12 col-md-4 ">
                                <div class="form-group">
                                    <label for="">SEND OUT LOCATION</label>
                                    <input value="{{eform.workOrderList.sendout_location|default:''}}"
                                    type="text" class="form-control" readonly name="sendout_location" id="id_sendout_location" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>
                            
                        </div> {% endcomment %}

                    </div>
                        
                    
                </div>
                
                
                <br>
                <div class="card">
                    <div class="card-header pb-0 mb-0">
                        <div class="row mb-3 bg-gray">
                            <div class="col">
                                <h4>Applied IMTE</h4>
                            </div>
                            <div class="col text-right">
                                <button type="button" id="btn-scan-imte" class="btn btn-sm btn-primary">SCAN</button>
                            </div>
                        </div>
                    </div>
                    <div class="card-body">

                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>
                                        E.I. / EWS No.
                                    </th>
                                    <th>
                                        DUE DATE
                                    </th>
                                </tr>
                            </thead>
                            <tbody id="imte-tbody">
                                
                                {% for data in imtes %}
                                <tr id="tr-{{data.imte}}">
                                    <td>
                                    {{data.imte}}
                                    </td>
                               
                                    <td>
                                    {{data.due_date|date:'Y-m-d'}}
                                    </td>
                               
                                    <td class="text-center">
                                        <button type="button" class="btn btn-sm imte-delete  btn-primary px-2 py-2" data-imte="{{data.imte}}"><i class="fa fa-times" aria-hidden="true"></i></button>
                                    </td>
                                </tr>
                                {% endfor %}
                                    
                            </tbody>
        
                        </table>
                    </div>
                </div>

                <br>

                <div class="card ">
                    <div class="card-header">
                        <h1>{{eform.title}}</h1>
                    </div>

                    <div class="card-body ">
                        
                        <div id="formio">
                        </div>
                    </div>
                </div>

                <div class="card mb-3 pt-0 ">
                    
                    <div class="card-body pt-3">
                        
                        <div class="row mt-3">
        
                            {% comment %} <div class="col-6">
                                <div class="form-group">
                                    <label for="">FAILURE SYMPTOM</label>
                                    <input form="eform" value="{{eform.workOrderList.failure_sym|default:''}}"
                                    type="text" class="form-control"  name="wo_failure_sym" id="id_failure_sym" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div> {% endcomment %}
        
                            <div class="col-6">
                                <div class="form-group">
                                    <label for="">FINDING</label>
                                    <input form="eform" value="{{eform.workOrder.finding|default:''}}"
                                    type="text" class="form-control"  name="wo_finding" id="id_finding" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>
                            <div class="col-6">
                                <div class="form-group">
                                    <label for="">ACTION</label>
                                    <input form="eform" value="{{eform.workOrder.action|default:''}}"
                                    type="text" class="form-control"  name="wo_action" id="id_action" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div>
                            {% comment %} <div class="col-6">
                                <div class="form-group">
                                    <label for="">REMARKS</label>
                                    <input form="eform" value="{{eform.workOrderList.remarks|default:''}}"
                                    type="text" class="form-control" name="wo_remarks" id="id_remarks" aria-describedby="helpId" placeholder="">
                                  </div>    
                            </div> {% endcomment %}
                        
                        </div>
        
                        <div class="row">
                            <div class="col text-center">
                                <strong>Overall Test Result: </strong>
                                <div class="form-check form-check-inline mt-0">
                                    <label class="form-check-label">
                                        <input class="form-check-input meta-input " form="eform" required
                                        {% if eform.overall_test_result == 'Pass' %}
                                            checked
                                        {% endif %}
                                             type="radio" name="overall_test_result_radio" id="" value="Pass"> Pass
                                        <input class="form-check-input meta-input " form="eform" required
                                        {% if eform.overall_test_result == 'Fail' %}
                                            checked
                                        {% endif %}
                                         type="radio" name="overall_test_result_radio" id="" value="Fail"> Fail
                                    </label>
                                </div>
                            </div>
                        </div>
                        {% if request.GET.flow != 'done' %}
                        <div class="row">
                            <div class="col text-center">
                            <strong>Verify SIC Resulta:</strong>
                            <div class="form-check form-check-inline mt-0" >
                                <label class="form-check-label" >
                                    <input class="form-check-input meta-input " form="eform" required 
                                        {% if eform.verify_sic_resulta == 'Pass' %}
                                            checked
                                        {% endif %}
                                             type="radio" name="verify_sic_resulta_radio" id="" value="Pass"> Pass
                                    <input class="form-check-input meta-input " form="eform" required
                                        {% if eform.verify_sic_resulta == 'Fail' %}
                                            checked
                                        {% endif %}
                                     type="radio" name="verify_sic_resulta_radio" id="" value="Fail"> Fail
                                </label>
                            </div>
                            </div>
                        </div>
                        {% if request.GET.flow == 'endorse'%}
                        <div class="row">
                            <div class="col text-center">
                            <strong>Endorsment Result:&nbsp;&nbsp;</strong>
                            <div class="form-check form-check-inline mt-0">
                                <label class="form-check-label">
                                    <input class="form-check-input meta-input " form="eform" required 
                                        {% if eform.endorsment_result == 'Pass' %}
                                            checked
                                        {% endif %}
                                            type="radio" name="endorsment_result_radio" id="" value="Pass"> Pass
                                    <input class="form-check-input meta-input " form="eform" required
                                        {% if eform.endorsment_result == 'Fail' %}
                                            checked
                                        {% endif %}
                                        type="radio" name="endorsment_result_radio" id="" value="Fail"> Fail
                                </label>
                            </div>
                            </div>
                        </div>
                        {% endif %}
                        {% endif %}
                        <br>
                        <div class="row text-center card-header">
                            <div class="col text-center">
                                <div class="staff-name">
                                    
                                    <small>Done By</small>
                                    <h5>{{eform.doneby}}</h5>
                                    <hr>
                                    <p>{{eform.doneDate}}</p>
                                </div>
                                {% if eform.eformSchema.endorsor_require %}
                                <div class="staff-name">
                                    <small>Verified By</small>
                                    <h5>{{eform.verifiedby}}</h5>
                                    <hr>
                                    <p>{{eform.verifiedDate}}</p>
                                </div>
                                <div class="staff-name">
                                    
                                    <small>Endorsed By</small>
                                    <h5>{{eform.endorsedby}}</h5>
                                    <hr>
                                    <p>{{eform.endorsedDate}}</p>
                                </div>
                                {% endif %} 
                            </div>
                        </div>
                        
        
                        
                        <br>
                        <div class="row text-center">
                            <div class="col">
                                <strong class="">End of Test</strong>
                            </div>
                        </div>
        
                    </div>
                </div>
        

                <!-- image upload -->
                <div id="ad1" role="tablist" aria-multiselectable="true">
                    <div class="card">
                        <div class="card-header" role="tab" id="section1HeaderId">
                            <h5 class="mb-0">
                                <a data-toggle="collapse" data-parent="#ad1" href="#section1ContentId" aria-expanded="true" aria-controls="section1ContentId">
                                    Image Upload
                                </a>
                            </h5>
                        </div>
                        <div id="section1ContentId" class="collapse show" role="tabpanel" aria-labelledby="section1HeaderId">
                            <div class="card-body">
                                <div class="form-group">
                                  <form id="fileForm" action="{% url 'api:eformfiles-list' %}" method='post'  enctype="multipart/form-data">
                                    <label for="">Upload Image</label>
                                  <input id="image_upload" type="file" class="form-control-file" accept="video/mp4,image/png,image/jpeg,image/bmp,image/jpeg" name="" id="" placeholder="" aria-describedby="fileHelpId">
                                  <small id="fileHelpId" class="form-text text-muted">Upload image from your device or camera</small>
                                  </form>
                                </div>

                                <table class="table" id="">
                                    <tr>
                                        <th>File</th>
                                        <th></th>
                                    </tr>
                                    <tbody id="uploaded_image_body">
                                        
                                        {% for f in eformFile %}
                                            <tr id="eformFile-{{f.id}}">
                                                <td>
                                                    {% if f.isImage %}
                                                        
                                                        <img src="{{f.file.url}}" class="" height="100px" alt="">
                                                    {% endif %}
                                                    {% if f.isVideo %}
                                                        <video src="{{f.file.url}}" class="" height="100px" alt=""></video>
                                                    {% endif %}
                                                    <a href="{{f.file.url}}" target="_blank">
                                                        {{f.filename}}
                                                    </a>
                                                </td>
                                                <td style="vertical-align : middle;">
                                                    <button type="button" data-fid="{{f.id}}" class="btn btn-sm btn-danger delete-eform-file" style="vertical-align : middle;" >DELETE</button>
                                                </td>
                                            </tr>
                                        {% empty %}
                                            <td>
                                                <tr>No File</tr>
                                            </td>
                                        {% endfor %}
                                    </tbody>
                                </table>

                            </div>
                        </div>
                    </div>
                   
                </div>


                <div class="row mt-3 no-print">
                    <div class="col text-right">
                        <form action="" method="post" id="eform">
                            {% csrf_token %}
                            <button type="button" id="btn-delete" value="delete" class="btn btn-danger">Delete</button>
                            <button type="button" id="btn-save " value="save" class="btn btn-success c-btn-s">Save</button>
                            <button type="button" id="btn-done " value="done" class="btn btn-info c-btn-s">Done</button>
                            <a name="" id="" target="_blank" class="btn btn-primary" href="{% url 'eform:printEform' eform.pk %}" role="button">Print</a>
                            <input type="hidden" name="dataJson" id="dataJson">
                            <input type="hidden" name="overall_test_result" id="overall_test_result" value="{{eform.overall_test_result}}">
                            <input type="hidden" name="action" value="" id="dataAction">
                            <input type="hidden" name="type" id="eform-type-id" value="{{request.GET.type}}">
                            <input type="hidden" name="next" id="eform-next-id" value="{{request.GET.next}}">
            </form>
                    </div>
                </div>
            </div>
                
            <div class="col-2 text-center no-print 
                
                {% if not is_psu and not is_meter %}
                    d-none
                {% endif %}
                    
            " id="aiContainer">
                <div class="sticky">
                    <div class="card
                        
                        {% if not is_meter %}
                            d-none
                        {% endif %}
                            
                    " id="meterUI">
                        <div class="card-body">
                            <div>
                                <h1 class="display-6 ims-capture" id="meter">
                                    11.91
                                </h1><h6>Voltage</h6>
                                <!-- <hr>
                                <p><span id="meter-imte-no">EI7710</span></p> -->
                                <p>
                                    Multimeter | 
                                    <span id="meterIMTE">{{meter.imte}}</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="card mt-3
                        
                        {% if not is_psu %}
                            d-none
                        {% endif %}
                            
                    " id="psuUI">
                        <div class="card-body">
                            <div>
                                <div class="row text-center">
                                    <div class="col">
                                        <h1 class="display-6 ims-capture" id="psu-current">
                                        3.0
                                        </h1><h6>Current</h6>
                                    </div>
                                    <div class="col">
                                        <h1 class="display-6 ims-capture" id="psu-voltage">
                                        11.91
                                        </h1><h6>Voltage</h6>
                                    </div>
                                </div>
                                <p>
                                    Power Supply |
                                    <span class="" id="psuIMTE">{{psu.imte}}</span>
                                </p>
                                <!-- <hr> -->
                                <!-- <p>EI5761 | PD56-10AD</p> -->
                                <!-- <p><span id="power-imte-no">EI5761</span></p> -->
                            </div>
                        </div>
                    </div>
                </div>
                
            </div>
            
        </div>
        <br>
        
    </div>

    <!-- Button trigger modal -->
    
    <!-- Modal -->
    <div class="modal fade" id="scan_modal" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">SCAN IMTE</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                </div>
                <div id="scan_modal__alert">

                </div>
                
                <video id="preview" class="d-none">
                    
                </video>
                <canvas id="preview__canvas">
                </canvas>
                <!-- <div class="modal-body">
                    Body
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary">Save</button>
                </div> -->
            </div>
        </div>
    </div>
    {% csrf_token %}
{% endblock body %}



{% block script %}
<!-- <script src='https://cdn.form.io/formiojs/formio.full.min.js'></script>
<script src="https://cdn.socket.io/4.0.1/socket.io.js"></script> -->
<script src="{% static 'eform/formio.full.min.js' %}"></script>
<script src="{% static 'eform/socket.io.js' %}"></script>
<script src="{% static 'eform/instascan.min.js' %}"></script>
<script src="{% static 'api/axios.min.js' %}"></script>
<script src="{% static 'eform/cameraIMTE.js' %}"></script>
<script src="{% static 'eform/eformScroll.js' %}"></script>
<script>
    let is_psu = '{{is_psu}}'=="True"
    let is_meter = '{{is_meter}}'=="True"
    
    const eformFile_url = `{% url "api:eformfiles-list" %}`
    const OCR_DECTECTION_IP = '{{OCR_DETECTION_IP}}'
    
    const imte_api_url = '{% url "api:imtes-list" %}'
    const set_imte_url = '{% url "api:imtes-set-imte-to-task" %}'
    const delete_imte_url = '{% url "api:imtes-delete-imte-from-task" %}'
    const get_all_imte_url = '{% url "api:imtes-get_imte_by_eform_id" %}'
    const eform_id = `{{eform.id}}`
    const user_id = `{{ request.user.id }}`

    dataJson= {{formSchema | safe}}
    data = {{eform.getFormDataJson |safe}}

    // data_object =  data.reduce((obj, item) => (obj[item.key] = item.data, obj) ,{});
    // console.log(data)
</script>
<script src="{% static 'eform/confirm.js' %}"></script>
<script src="{% static 'eform/eformFile/eformFile.js' %}"></script>
<script src="{% static 'eform/eform.js' %}"></script>
<script src="{% static 'eform/checkurl.js' %}"></script>
{% endblock script %}
    
    